ih-muse
IH-Muse is designed for seamless integration with the IH system, providing efficient metrics tracking, element registration, and event recording capabilities in both Python and Rust.
- Github repository: https://github.com/infinitehaiku/ih-muse/
- Documentation https://ih-muse.readthedocs.io/en/latest/
Key Features
- Element Registration: Easily register elements within the Muse system, including metadata and hierarchical relationships.
- Metric Reporting: Report metrics related to registered elements to monitor application and system performance.
- Event Recording & Replaying: Record events for later analysis or replay them for testing and debugging.
- Multi-Client Configuration: Supports different client types, including
Poet
(real-time interaction) andMock
(testing). - Asynchronous Operations: Optimized for non-blocking, async-capable operations.
- Multi-Language Support: Available in both Python and Rust, with cross-language functionality and interoperability.
- Extensible and Configurable: Highly configurable to fit various use cases in monitoring, analytics, and diagnostics.
Table of Contents
Installation
IH-Muse can be installed in Python and configured to work in conjunction with the Muse system. Rust users can include IH-Muse as a dependency in their Cargo project.
Python Installation
Ensure you have maturin
installed for building Rust extensions:
Clone the repository and install IH-Muse with:
Rust Installation
To add IH-Muse to your Rust project, use the following cargo
command:
This will automatically add the latest version of IH-Muse to your Cargo.toml
dependencies:
[]
= "latest-compatible-version"
Alternatively, you can manually add it to your Cargo.toml
:
[]
= "*"
Getting Started
Python Example
=
=
await
= await
await
Rust Example
use *;
use HashMap;
async
Configuration
IH-Muse offers a rich set of configuration options to customize its behavior. Below are key parameters you can set:
- endpoints: A list of URLs for Muse services.
- client_type: Select between
Poet
(real client) orMock
(testing). - default_resolution: Choose a default timestamp resolution (e.g., milliseconds).
- element_kinds: Register element types with the Muse system.
- metric_definitions: Define metrics for tracking.
- recording_enabled: Enable event recording.
- recording_path: Specify a file path if recording is enabled.
Examples
IH-Muse is versatile for various use cases:
- Monitoring Application Performance: Track metrics and gain insights into application health.
- Simulating Metrics and Events for Testing: Use the
Mock
client to simulate system behavior. - Real-Time Data Collection: Connect to the Muse system to collect live data for real-time analytics.
Contributing
Contributions are welcome! Please see our CONTRIBUTING.md for guidelines on how to contribute, report issues, and request features.
License
IH-Muse is licensed under the MIT License.